package lueder.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class LanguageBoxServlet
 */
public class LanguageBoxServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public LanguageBoxServlet() {
		super();
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String path = request.getContextPath() + "/";
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		out.println("<div class='right_content'>");
		out.println("<div class='languages_box'>");
		out.println("<span class='red'>Languages:</span>");
		out.println("<a href='#' class='selected'><img src='" + path
				+ "images/gb.gif' alt='' title='' border='0' /></a>");
		out.println("<a href='#'><img src='" + path
				+ "images/fr.gif' alt='' title='' border='0' /></a>");
		out.println("<a href='#'><img src='" + path
				+ "images/de.gif' alt='' title='' border='0' /></a>");
		out.println("</div>");
		out.println("<div class='currency'>");
		out.println("<form action='" + path
				+ "Search' method='GET' name='search'>");
		out.println("<input type='text' class='search_input' name='searchstring' />&#160;");
		out.println("<button type='submit' name='submit' value='search'><img src='"+path+"images/search.png' /></button>");
		out.println("</form>");
		out.println("</div>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
